<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.roadmap.common.RdcResourceBundle"%>
<%@ page import= "com.roadmap.struts.action.ActionConst"%>
<%@page import="com.roadmap.common.BaseConst"%>
<%@page import="com.roadmap.ui.HTMLComponentWriter"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String user_ssn_id = (String)request.getSession().getAttribute(ActionConst.Aspirant_Id_In_Session);
String user_req_id = (String)request.getParameter(ActionConst.Aspirant_Id_In_Request);
if(user_req_id == null){
	user_req_id = user_ssn_id;
}
String goal_req_id = (String)request.getParameter(ActionConst.Item_Id_In_Request);
if(goal_req_id == null){
	goal_req_id = "";
}
String action = request.getParameter(ActionConst.Method_Symbol);
if(action == null) {
	action = "view";
}

HTMLComponentWriter htmlCom = new HTMLComponentWriter(out);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/> 
<link href="res/css/layout.css" rel="stylesheet" type="text/css" media="all" />
<link href="res/css/life.css" rel="stylesheet" type="text/css" media="all" />
<link href="res/css/widget.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="dwr/util.js"></script>
<script type="text/javascript" src="dwr/engine.js"></script>
<script type="text/javascript" src="dwr/interface/RdcAjax.js"></script>
<script type="text/javascript" src="res/js/func.js"></script>
<script type="text/javascript" src="res/js/widget.js"></script>
<script type="text/javascript" src="res/js/component.js"></script>
<title><logic:present name="goal"><bean:write name="goal" property="name"/> |</logic:present> 目标 | <%=RdcResourceBundle.COMPANY_NAME %></title>
</head>

<body>
<div id="container">
	<jsp:include page="/admin/myheader.jsp"></jsp:include>
	
	<!-- main body -->
	<div class="mainbody"><div class="manager">
		<jsp:include page="/admin/life/nav_btns.jsp"/>
			
		<!-- middle part: content -->
		<div class="middle-part">
			<div class="section"  style="border-bottom: 1px solid #E78F28">
				<div class="title-sp">
					<a href="aspirant.do?uid=<%=user_req_id %>"><bean:write name="<%=ActionConst.Aspirant_Name_In_Request %>"/></a>
					<span class="doubleGreat">&gt;&gt;</span>
					<a href="goal.do?act=all&uid=<%=user_req_id %>">所有目标</a>
					
					<logic:present name="goal">
						<span class="doubleGreat">&gt;&gt;</span>
						<bean:write name="goal" property="whatItIs"/>
					</logic:present>
				</div>
				
				<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
					<div id="btnSubSec" class="float-right"><input class="dropParentBtn" type="button" value="更多操作" onclick="dropMenu.showWith(this);"/></div>
				</logic:present>
			</div>
			
			<% if (action.equalsIgnoreCase("create")) {%>
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="goalNew" class="section" style="display: none"><div class="sub-section">
				<table class="life-table">
					<tr>
						<td class="row-td">目标名称</td><td class="input-td" colspan="3"><input id="newName" type="text" class="input-text" style="width:402px;size="65" title="目标名称(1~50)" maxlength="50" /></td>
					</tr>
					<tr>
						<td class="row-td">目标内容</td><td class="input-td" colspan="3"><textarea id="newContent" class="input-text" style="width:402px;height:100px;"
																						title="目标内容(1~500)"></textarea></td>
					</tr>
					<tr>
						<td class="row-td">预定开始日期</td>
						<td class="input-td"><input id="newStartDate" type="text" class="shortDate" maxlength="10" title="预定开始日期(yyyy-MM-dd)" onfocus="datePicker.showWith(this);"/></td>
						<td class="row-td">预定结束日期</td>
						<td class="input-td"><input id="newEndDate" type="text" class="shortDate" maxlength="10" title="预定结束日期(yyyy-MM-dd)" onfocus="datePicker.showWith(this);"/></td>
					</tr>
					<tr>
						<td class="row-td">优先级</td>
						<td class="input-td">
							<% htmlCom.writeGoalPrioritySelect("newPriority"); %>
						</td>									
						<td class="row-td">访问权限</td>
						<td class="input-td">
							<% htmlCom.writeVisibilitySelect(request); %>
						</td>
					</tr>	
					<tr>
						<td colspan="4">
							<input id="createGoal" type="button" class="confirmBtn" value="保存" onclick="createGoal();"/>
							<input type="button" class="cancelBtn" value="取消" onclick="window.location.href='goal.do?act=all&uid=<%=user_req_id %>';"/>
						</td>
					</tr>
				</table>
			</div></div>
			</logic:present>
			<%} if (action.equalsIgnoreCase("view")) {%>
			<logic:notPresent name="goal">
				<div class="section"><span id="goalDoesntExist" class="prompt-message">您查看的目标不存在，可能已被删除</span></div>
			</logic:notPresent>
			
			<logic:present name="goal">
			<div id="goalView" class="section" style="display: none"><div class="sub-section">
				<bean:define id='status' name='goal' property='status'/>
				<table class="life-table">
					<tr>
						<td class="row-td">目标名称</td><td colspan="3" class="input-td"><span id="viewName" class="desc"><bean:write name="goal" property="name"/></span></td>
					</tr>
					<tr>
						<td class="row-td">目标内容</td><td colspan="3" class="input-td"><span id="viewContent"><bean:write name="goal" property="content"/></span></td>
					</tr>
					<tr>
						<td class="row-td">当前进度</td><td class="input-td"><bean:write name='goal' property='progress'/>%</td>
						<td class="row-td">当前状态</td><td class="input-td"><span id="viewStatus"><%=RdcResourceBundle.LIFEGOAL_STATUS_DESCRIPTIONS[(Integer)status]%></span>
							<input id="statueValue" type="hidden" value="<%=status %>"/></td>	
					</tr>
					<tr>
						<td class="row-td">已分配量</td><td class="input-td"><bean:write name='goal' property='assignedProportion'/>%</td>
						<td class="row-td">任务数</td><td class="input-td">
							<a href="task.do?act=all&uid=<%=user_req_id %>&pid=<%=goal_req_id %>" title="查看所有任务">共<bean:write name='goal' property='taskCount'/>个</a>&nbsp;<span class="doubleGreat">&gt;&gt;</span>
						</td>
					</tr>
					<tr>
						<td class="row-td">优先级</td><td class="input-td"><span id="viewPriority"><bean:write name='goal' property='priorityDesc'/></span></td>	
						<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
						<td class="row-td">访问权限</td><td class="input-td"><span id='viewVisibility'><bean:write name='goal' property='visibilityDesc'/></span></td>
						</logic:present>
					</tr>	
					<tr>
						<td class="row-td">预定开始日期</td><td class="input-td"><span id="viewStartDate"><bean:write format='yyyy-MM-dd' name='goal' property='scheduledStartDate'/></span></td>
						<td class="row-td">预定达到日期</td><td class="input-td"><span id="viewEndDate"><bean:write format='yyyy-MM-dd' name='goal' property='scheduledEndDate'/></span></td>	
					</tr>
					<tr>
						<td class="row-td">实际开始日期</td><td class="input-td" width="240px"><span id="realStartDate"><bean:write format='yyyy-MM-dd' name='goal' property='realStartDate'/></span></td>
						<td class="row-td">实际结束日期</td><td class="input-td"><span id="realEndDate"><bean:write format='yyyy-MM-dd' name='goal' property='realEndDate'/></span></td>						
					</tr>
					<tr>
						<td class="row-td">创建时间</td><td class="input-td"><span id="viewCreated"><bean:write format='yyyy-MM-dd HH:mm:ss' name='goal' property='createdTime'/></span></td>
						<td class="row-td">上次更新时间</td><td class="input-td" width="150px"><span id="viewUpdated"><bean:write format='yyyy-MM-dd HH:mm:ss' name='goal' property='updatedTime'/></span></td>
					</tr>
					
					<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">			
					<tr>
						<td colspan="4">
							<input type="button" class="confirmBtn" value="编辑" onclick="goToEdit(getCurGoal());"/>
							<input type="button" class="cancelBtn" value="关闭" onclick="window.location.href = 'goal.do?act=all&uid=<%=user_ssn_id %>';"/>
						</td>
					</tr>
					</logic:present>
				</table>
			</div></div>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
			<!-- this part can only be viewed by the information owner -->
			<div id="goalEdit" class="section" style="display: none"><div class="sub-section">
				<table class="life-table">
					<tr>
						<td class="row-td">目标名称</td><td class="input-td" colspan="3">
							<input id="editName" type="text" class="input-text" style="width:402px;" maxlength="50" title="目标名称(1~50)" />
						</td>
					</tr>
					<tr>
						<td class="row-td">目标内容</td><td class="input-td" colspan="3">
							<textarea id="editContent" class="input-text" style="width:402px;height:100px;" title="目标内容(1~500)"	></textarea>
						</td>
					</tr>
					<tr>
						<td class="row-td">预定开始日期</td>
						<td class="input-td"><input id="editStartDate" type="text" class="shortDate" maxlength="10" title="预定开始日期(yyyy-MM-dd)" onfocus="datePicker.showWith(this);"/></td>
						<td class="row-td">预定达到日期</td>
						<td class="input-td"><input id="editEndDate" type="text" class="shortDate" maxlength="10" title="预定达到日期(yyyy-MM-dd)" onfocus="datePicker.showWith(this);"/></td>
					</tr>
					<tr>
						<td class="row-td">优先级</td><td class="input-td"><% htmlCom.writeGoalPrioritySelect("editPriority"); %></td>									
						<td class="row-td">访问权限</td><td class="input-td"><% htmlCom.writeVisibilitySelect(request); %></td>
					</tr>
					<tr>
						<td colspan="4">							
							<input id="editGoal" type="button" class="confirmBtn" value="保存" onclick="saveGoal();"/>
							<input type="button" class="cancelBtn" value="取消" onclick="showSection('','goalView');"/>
						</td>
					</tr>
				</table>
			</div></div>
			</logic:present>
			
			<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
				<logic:present name="goal">
				<bean:define id='status' name='goal' property='status'/>
				<% 
					int state = (Integer) status; 
					if (state == BaseConst.LIFEGOAL_STATUS_UNSCHEDULED 
							|| state == BaseConst.LIFEGOAL_STATUS_SCHEDULED 
							|| state == BaseConst.LIFEGOAL_STATUS_UNDERGOING) {
				%>
				<div id="taskExecSec" class="section" style="text-align:left;">
					<span class="doubleGreat">&gt;&gt;</span>&nbsp;<a href="task.do?act=create&uid=<%=user_req_id %>">为目标创建任务</a>
				</div>
				<%} %>
				</logic:present>
			</logic:present>
			
			<!-- show comments -->
			<jsp:include page="/pagelet/commentPagelet.jsp"/>
			</logic:present><!-- view goal -->
			<%} // action == 'view'%>
	</div>
	
	<!-- right part: -->
	<div class="right-part">
	</div>
	
	</div>
	
	<div class="clear-div"></div>
	</div>
	
	<jsp:include page="/res/jsp/footer.jsp"></jsp:include>
</div>


<logic:present name="<%=ActionConst.Visitor_Is_Owner %>">
<% if (action.equalsIgnoreCase("create")) {%>
<script type="text/javascript">
 	function createGoal(){		
		if(checkNewInputs() == false) {
			return;
		}
		
		var goal = {id:null};
		goal.aspirantId = ssn_uid;
		goal.name = $("newName").value;
		goal.content = $("newContent").value;		
		goal.priority = $("newPriority").selectedIndex;
		goal.scheduledStartDate = RDC.util.stringToDate($("newStartDate").value, RDC.jsconst.DATE_FORMAT_yMd);
		goal.scheduledEndDate = RDC.util.stringToDate($("newEndDate").value, RDC.jsconst.DATE_FORMAT_yMd);
		goal.visibility = $("limitedAccess").selectedIndex;
		RDC.gui.disable("createGoal");
		
		dwr.engine.setAsync(false);
		RdcAjax.saveGoal(goal, function(result){
			RDC.gui.enable("createGoal");
			if(typeof result.id === "undefined"){
				PromptDialog.show("保存目标失败，因为" + result);
				return;
			}
			window.location.href = "goal.do?act=view&uid=" + goal.aspirantId + "&id=" + result.id;
		});
		dwr.engine.setAsync(true);
	}
	
	function goToCreate(){	
		dt = new Date();
		$("newName").value = "";
		$("newStartDate").value = RDC.util.dateToString(dt, RDC.jsconst.DATE_FORMAT_yMd);
		$("newEndDate").value = RDC.util.dateToString(RDC.util.nextDate(dt), RDC.jsconst.DATE_FORMAT_yMd);
		$("newContent").value = "";
		showSection("new-goal", "goalNew");
		setCurGoal(null); 
		$("newName").focus();
		RDC.gui.hide("btnSubSec");
	}
</script>
<%} else if (action.equalsIgnoreCase("view")) {%>
<script type="text/javascript">
	function createDropMenu(){
		if(!RDC.gui.exist("btnSubSec")){
			return;
		}
		
		dropMenu = new DropMenu("60px");
		var item = dropMenu.createItem("新建");
		item.id = "item_create";
		item.onclick = function(){
			window.location.href = "goal.do?act=create";
		};
		dropMenu.addItem(item);
		
		item = dropMenu.createItem("完成");
		item.id = "item_complete";
		item.onclick = function(){
			goToCompleteGoal(getCurGoal());
		};
		dropMenu.addItem(item);
		
		item = dropMenu.createItem("取消");
		item.id = "item_cancel";
		item.onclick = function(){
			goToCancelGoal(getCurGoal());
		};
		dropMenu.addItem(item);
		
		item = dropMenu.createItem("删除");
		item.id = "item_delete";
		item.onclick = function(){
			goToDelete();
		};
		dropMenu.addItem(item);
	}
	
	//-------------------------------------------------------------------
	// delete goal
	function goToDelete(){
		var gid = getCurGoal();
		if(gid == null || gid == ""){
			PromptDialog.show("目标不存在");
			return;
		}
		
		var goal = "<b>" + $("viewName").innerHTML + "</b>";
		var popupWin = new PopUpWindow("信息提示", "您确定要删除该目标'"+goal+"'吗？<br>删除目标同时会删除相应的计划", 0);
		popupWin.addAction(deleteAction(popupWin, gid));
		popupWin.addAction(closeAction(popupWin));
		popupWin.show();
	}
	
	// actions
	function closeAction(dlg){
		var btn = document.createElement("input");		
		btn.type = "button";
		btn.className = "cancelBtn";
		btn.value = "返回";
		btn.onclick = function(){
			dlg.dispose();
		};		
		return btn;
	}
	
	function deleteAction(dlg, gid){
		var btn = dlg.createAction("确定");
		btn.id = "confirm_delete";
		btn.onclick = function(){
			RDC.gui.disable(btn.id);
			RdcAjax.deleteGoal(gid, function(result){
				if(result !== true){
					dlg.updateMessage("删除目标失败，由于" + result);
					RDC.gui.enable(btn.id);
				}
				else {
					window.location.href = "goal.do?act=all&uid=" + ssn_uid;
				}
			});
		}
		return btn;
	}

	//complete
	function goToCompleteGoal(gid){
		if(gid == null || gid == ""){
			PromptDialog.show("请选择一个目标");
			return;
		}
		
		var status = "<%=RdcResourceBundle.LIFEGOAL_STATUS_DESCRIPTIONS[BaseConst.LIFEGOAL_STATUS_UNDERGOING]%>";
		var state = $("viewStatus").innerHTML;
		if(state != status){
			PromptDialog.show("状态为进行中的目标才能执行完成操作");
			return;
		}
		
		setCurGoal(gid);
		var goal = "<b>" + $("viewName").innerHTML + "</b>";
		var popupWin = new PopUpWindow("信息提示", "您确定完成了目标'" + goal + "'？状态修改后，将不能回滚。", 0);
		popupWin.addAction(completeAction(popupWin, gid));
		popupWin.addAction(closeAction(popupWin));
		popupWin.show();
	}
	
	function completeAction(dlg, gid){
		var btn = dlg.createAction("确定");
		btn.id = "confirm_complete";
		btn.onclick = function(){
			RDC.gui.disable(btn.id);
			RdcAjax.completeGoal(gid, function(result){
				if(typeof result.id === "undefined"){
					dlg.updateMessage("修改目标状态失败，由于" + result);
					RDC.gui.enable(btn.id);
				}
				else {
					dlg.updateMessage("恭喜您完成了一个目标，你太棒了!");
					dlg.removeAction(btn);
					
					$("viewStatus").innerHTML = "<%=RdcResourceBundle.LIFETASK_STATUS_DESCRIPTIONS[BaseConst.LIFETASK_STATUS_COMPLETED]%>";
					$("viewUpdated").innerHTML = RDC.util.dateToString(result.updatedTime, "yyyy-MM-dd HH:mm:ss");
					showSection("", "goalView");
				}
			});
		}
		return btn;
	}
	//cancel
	function goToCancelGoal(gid){
		if(gid == null || gid == ""){
			PromptDialog.show("请选择一个目标");
			return;
		}
		
		var state = $("viewStatus").innerHTML;
		var completed = "<%=RdcResourceBundle.LIFETASK_STATUS_DESCRIPTIONS[BaseConst.LIFETASK_STATUS_COMPLETED]%>";
		var canceled = "<%=RdcResourceBundle.LIFETASK_STATUS_DESCRIPTIONS[BaseConst.LIFETASK_STATUS_CANCELED]%>";
		if(state == completed || state == canceled){
			PromptDialog.show("已完成或已取消的目标不能被取消");
			return;
		}
		
		setCurGoal(gid);
		var goal = "<b>" + $("viewName").innerHTML + "</b>";
		var popupWin = new PopUpWindow("信息提示", "您确定要取消该目标'"+goal+"'？状态修改后，将不能回滚。", 0);
		popupWin.addAction(cancelAction(popupWin, gid));
		popupWin.addAction(closeAction(popupWin));
		popupWin.show();
	}
	
	function cancelAction(dlg, gid){
		var btn = dlg.createAction("确定");
		btn.id = "confirm_cancel";
		btn.onclick = function(){
			RDC.gui.disable(btn.id);
			RdcAjax.cancelGoal(gid, function(result){
				if(typeof result.id === "undefined"){
					dlg.updateMessage("修改目标状态失败，由于" + result);
					RDC.gui.enable(btn.id);
				}
				else {
					dlg.updateMessage("修改目标状态成功");
					dlg.removeAction(btn);
					$("viewStatus").innerHTML = "<%=RdcResourceBundle.LIFETASK_STATUS_DESCRIPTIONS[BaseConst.LIFETASK_STATUS_CANCELED]%>";
					$("viewUpdated").innerHTML = RDC.util.dateToString(result.updatedTime, "yyyy-MM-dd HH:mm:ss");
					showSection("", "goalView");
				}
			});
		}
		return btn;
	}
	
	function goToEdit(gid){
		$("editName").value = $("viewName").innerHTML;
		$("editStartDate").value = $("viewStartDate").innerHTML;
		$("editEndDate").value = $("viewEndDate").innerHTML;
		$("editPriority").value = $("viewPriority").innerHTML;
		$("editContent").value = $("viewContent").innerHTML;
		$("limitedAccess").value = $("viewVisibility").innerHTML;
		showSection("", "goalEdit");
		$("editName").focus();
	}
	
</script>
<%} %>
</logic:present>
<script type="text/javascript">
	var sections = ["goalNew", "goalView", "goalEdit"];
	var goalId = "<%= goal_req_id%>"; // which goal is chosen
	var req_uid = "<%=user_req_id%>";
	var ssn_uid = "<%=user_ssn_id%>";
	var dropMenu = null;
	var datePicker = new DatePicker();
	var commentUtil = null;
	
	window.onload = function(){
		act = "<%=action%>";
		if(act === "view") {
			if(typeof createDropMenu !== "undefined") {
				createDropMenu();
			}
			RDC.gui.display("goalView");
			
			commentUtil = new CommentUtil("LifeGoal", goalId, ssn_uid, req_uid);
		}
		else {
			goToCreate();
		}
	}

	function setCurGoal(gid){
		goalId = gid;
	}
	
	function getCurGoal(){
		return goalId;
	}
	
	function showSection(title, sec){
		for(var i = 0; i < sections.length; i++){
			if(sec != sections[i]){
				RDC.gui.hide(sections[i]);
			}
		}
		RDC.gui.display(sec);
	}

	function checkName(value){
		if(RDC.util.verifyText(value, 1, 50) == false){
			PromptDialog.show("目标名称的字符数在1~50之间");
			return false;
		}
		else {
			return true;
		}
	}
	
	function checkContent(value){
		if(RDC.util.verifyText(value, 1, 500) == false){
			PromptDialog.show("目标内容的字符数在1~500之间");
			return false;
		}
		else {
			return true;
		}
	}
	
	function verifyDate(value){
		if(RDC.util.verifyFutureDate(value, RDC.jsconst.DATE_FORMAT_yMd) == false){
			PromptDialog.show("目标达到日期必须是未来某个时间");
			return false;
		}
		else {
			return true;
		}
	}
	
	function checkNewInputs(){
		if(checkName($("newName").value) == false){
			return false;
		}	
		if(verifyDate($("newEndDate").value) == false){
			return false;
		}	
		if($("newPriority").selectedIndex < 1){
			PromptDialog.show("请选择目标的优先级");
			return false;
		}		
		if(checkContent($("newContent").value) == false){
			return false;
		}
		return true;
	}
	
	function checkEditInputs(){
		if(checkName($("editName").value) == false){
			return false;
		}
		if($("editPriority").selectedIndex < 1){
			PromptDialog.show("请选择目标的优先级");
			return false;
		}		
		if(checkContent($("editContent").value) == false){
			return false;
		}
		return true;
	}
	
	function saveGoal(){
		if(!checkEditInputs()) {
			return;
		}
		var goal = {id:getCurGoal()};
		goal.aspirantId = ssn_uid;
		goal.name = $("editName").value;
		goal.content = $("editContent").value;		
		goal.priority = $("editPriority").selectedIndex;
		goal.status = parseInt($("statueValue").value);
		goal.scheduledStartDate = RDC.util.stringToDate($("editStartDate").value, RDC.jsconst.DATE_FORMAT_yMd);
		goal.scheduledEndDate = RDC.util.stringToDate($("editEndDate").value, RDC.jsconst.DATE_FORMAT_yMd);
		goal.createdTime = RDC.util.stringToDate($("viewCreated").innerHTML, "yyyy-MM-dd HH:mm:ss");
		goal.visibility = $("limitedAccess").selectedIndex;
		RDC.gui.disable("editGoal");
		
		RdcAjax.saveGoal(goal, function(result){
			if(typeof result.id === "undefined"){
				PromptDialog.show("保存目标失败，由于" + result);
			}
			else {
				dwr.util.setValue("viewContent", result.content);
				dt = RDC.util.dateToString(result.updatedTime, "yyyy-MM-dd HH:mm:ss");
				dwr.util.setValue("viewUpdated", RDC.util.dateToString(result.updatedTime, "yyyy-MM-dd HH:mm:ss"));
				dwr.util.setValue("viewName", $("editName").value);
				dwr.util.setValue("viewPriority", $("editPriority").value);
				dwr.util.setValue("viewStartDate", $("editStartDate").value);
				dwr.util.setValue("viewEndDate", $("editEndDate").value);
				dwr.util.setValue("viewVisibility", $("limitedAccess").value);
				showSection("", "goalView");
			}
			RDC.gui.enable("editGoal");
		});
	}
	
</script>

</body>

</html>
